import React, { Fragment } from 'react';
import { Col, Row } from 'antd';
import { connect } from 'dva';
import { Link } from 'umi';
import StandardTable from '../../components/StandardTable/index'

@connect(({ basicDataModel }) => ({
    basicDataModel,
}))
class InvoicesInfo extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
        }
    }

    // componentWillMount=()=>{
    //     console.log('componentWillMount,挂载前调用，初始化渲染时调用');
    // }
    // componentWillUpdate=()=>{
    //     console.log('componentWillUpdate,组件更新时调用');
    // }


    static getDerivedStateFromProps() {
        console.log("getDerivedStateFromProps，组件初始化和更新时调用");
        return null;
    }

    componentDidMount() {
        console.log('componentDidMount，初始化渲染时调用（挂载后调用）');
    }
    shouldComponentUpdate() {
        console.log("shouldComponentUpdate，组件更新时调用，在此可拦截更新");
        return true;
    }
    getSnapshotBeforeUpdate() {
        console.log("getSnapshotBeforeUpdate，组件更新时调用");
        return null;
    }

    componentDidUpdate() {
        console.log("componentDidUpdate，组件更新后调用");
    }
    componentWillUnmount = () => {
        console.log('componentWillUnmount，组件卸载时调用');
    }

    // componentWillReceiveProps=()=>{
    //     console.log('componentWillReceiveProps,父组件状态更新触发');
    // }
    render() {
        console.log("render");
        const { data = {}, columns, selectedRows } = this.props;
        return (
            <Fragment>
                <StandardTable
                    selectedRows={selectedRows}
                    onSelectRow={() => { }}
                    rowSelection={null}
                    data={data}
                    columns={columns}
                    onChange={() => { }}
                    rowKey={r => r.uuid}
                />
            </Fragment>
        );
    }
}

export default InvoicesInfo;
